package com.tyl.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {
    //获取配置文件信息的端口号
    @Value("${server.port}")
    private int port;
    @GetMapping("/selectAll")
    public String ProductSelectAll(){
        return "这是商品模块";
    }
    @GetMapping("/selectOne/{id}")
    public String selectById( @PathVariable("id") Integer id){
        return "商品模块的Id："+id+"当前端口号+"+port;
    }
}
